home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / ike.zip / ICO.H < prev    next >
C/C++ Source or Header  |  1991-01-08  |  6KB  |  174 lines

  1. #define TBM_CREATEBUTTON   (WM_USER+100)
  2.  
  3. #define IDM_HELP                1999
  4. #define IDM_NEW                 2000
  5. #define IDM_OPEN                2001
  6. #define IDM_SAVE                2002
  7. #define IDM_SAVEAS              2003
  8. #define IDM_CLOSE               2004
  9. #define IDM_EXIT                2005
  10. #define IDM_ABOUT               2006
  11. #define IDM_COPY                2010
  12. #define IDM_PASTE               2011
  13. #define IDM_UNDO                2012
  14. #define IDM_SMALLBRUSH          2020
  15. #define IDM_MEDIUMBRUSH         2021
  16. #define IDM_LARGEBRUSH          2022
  17.  
  18. #define ID_PENCIL               256
  19. #define ID_LINE                 257
  20. #define ID_OPENRECT             258
  21. #define ID_FILLRECT             259
  22. #define ID_CIRCLE               260
  23. #define ID_FILLCIRC             261
  24. #define ID_SELECT               262
  25. #define ID_FLOOD                263
  26.  
  27. #define ID_COLOR0               200
  28. #define ID_COLOR1               201
  29. #define ID_COLOR2               202
  30. #define ID_COLOR3               203
  31. #define ID_COLOR4               204
  32. #define ID_COLOR5               205
  33. #define ID_COLOR6               206
  34. #define ID_COLOR7               207
  35. #define ID_COLOR8               208
  36. #define ID_COLOR9               209
  37. #define ID_COLOR10              210
  38. #define ID_COLOR11              211
  39. #define ID_COLOR12              212
  40. #define ID_COLOR13              213
  41. #define ID_COLOR14              214
  42. #define ID_COLOR15              215
  43.  
  44. #define ID_ROPBASE              700
  45.  
  46.  
  47. #pragma pack(1)
  48.  
  49. typedef struct tagIconHeader
  50. {
  51.   WORD icoReserved;
  52.   WORD icoResourceType;  /* must be 1 */
  53.   WORD icoResourceCount;
  54. /*
  55.   ICONDIRECTORY icoDir[icoResourceCount];
  56. */
  57. } ICONHEADER;
  58.  
  59. typedef struct tagIconDirectory
  60. {
  61.   BYTE Width;
  62.   BYTE Height;
  63.   BYTE ColorCount;
  64.   BYTE bReserved1;
  65.   WORD bReserved2;
  66.   WORD bReserved3;
  67.   DWORD icoDIBSize;    /* number of bytes */
  68.   DWORD icoDIBOffset;  /* byte offset from start of file to image */
  69. /*
  70.   BYTE  image[];
  71. */
  72. } ICONDIRECTORY;
  73.  
  74.  
  75. typedef struct tagRGB
  76. {
  77.   BYTE  red,
  78.         green,
  79.         blue;
  80. } RGB;
  81.  
  82.  
  83. #define MAXTOOLS  32
  84.  
  85. typedef struct tagToolInfo
  86. {
  87.   int    idTool;
  88.   HANDLE hData;
  89.   WORD   wToolStyle;
  90. #define TOOL_ICON   1
  91. #define TOOL_COLOR  2
  92. } TOOLINFO;
  93.  
  94. typedef struct tagToolBox
  95. {
  96.   int  nRows;
  97.   int  cxButton, 
  98.        cyButton;
  99.   int  nButtons;
  100.   int  idSelectedTool;
  101.   HWND hwndSelectedTool;
  102.   TOOLINFO toolInfo[MAXTOOLS];
  103. } TOOLBOX, FAR *LPTOOLBOX;
  104.  
  105.  
  106. typedef struct tagIconInfo
  107. {
  108.   HICON  hIcon;
  109.   HANDLE hBitmapBits;
  110.   HANDLE hBitmapInfo;
  111.   WORD   fFlags;
  112. #define STATE_DIRTY   0x0001
  113. #define STATE_SOMETHING_SELECTED  0x0002
  114.   char   szFilename[128];
  115. } ICONINFO;
  116.  
  117.  
  118. extern HWND   hWndMain;
  119. extern HWND   hWndEdit;
  120. extern HWND   hWndActualImage;
  121. extern HWND   hWndDebug;
  122. extern HANDLE hInst;
  123. extern ICONINFO IconInfo;
  124. extern ICONHEADER IconHeader;
  125. extern ICONDIRECTORY IconDir;
  126. extern WORD CurrentColor;
  127. extern WORD iCurrentTool;
  128.  
  129. extern  int  PASCAL WinMain(WORD hInstance,WORD hPrevInstance,char FAR *lpCmdLine,int nCmdShow);
  130. extern  int ICOViewInit(WORD hInstance);
  131. extern  VOID PASCAL NewIcon(void);
  132. extern  int  PASCAL ColorCountToPlanes(int nClr);
  133. extern  VOID PASCAL SetIconPixel(int x,int y,int iColor);
  134. extern  int  PASCAL GetIconPixel(int x,int y);
  135. extern  VOID PASCAL FAR IconPlotLine(int x,int y,char FAR *lpData);
  136. extern  int  PASCAL FAR OpenFileDlgProc(WORD hDlg,WORD message,WORD wParam,long lParam);
  137. extern  VOID UpdateListBox(WORD hDlg);
  138. extern  VOID ChangeDefExt(char near *Ext,char near *Name);
  139. extern  VOID SeparateFile(char FAR *lpDestPath,char FAR *lpDestFileName,char FAR *lpSrcFileName);
  140. extern  int  PASCAL FAR SaveAsDlgProc(WORD hDlg,WORD message,WORD wParam,long lParam);
  141. extern  long PASCAL FAR ICOViewWndProc(HWND hWnd,WORD message,WORD wParam,long lParam);
  142. extern  long PASCAL FAR ICOEditWndProc(HWND hWnd,WORD message,WORD wParam,long lParam);
  143. extern  long PASCAL FAR ICOImageWndProc(HWND hWnd,WORD message,WORD wParam,long lParam);
  144. extern  long PASCAL FAR ICODebugWndProc(HWND hWnd,WORD message,WORD wParam,long lParam);
  145. extern  BOOL PASCAL IconPromptForSave(HWND hWnd);
  146. extern  VOID PASCAL IconUndo(void);
  147. extern  VOID PASCAL IconCheckpoint(void);
  148. extern  BOOL FAR PASCAL About(HWND, unsigned, WORD, LONG);
  149. extern  VOID PASCAL InvalidateAllWindows(void);
  150.  
  151. /* Icondraw.C */
  152. extern  VOID PASCAL DisplayDIBitmap(HWND hWnd,WORD hDC,WORD hBits);
  153. extern  VOID PASCAL DrawCircleInBitmap(HWND hWnd,WORD hDC,WORD hBits,int x1,int y1,int x2,int y2);
  154. extern  VOID PASCAL FloodFillBitmap(HWND hWnd,HDC hDC,HANDLE hBits,int x1,int y1);
  155.  
  156. /* Icoread.C */
  157. extern  int  ICORead(HWND hWnd,char *pszFile);
  158.  
  159. /* Icowrite.C */
  160. extern  int  ICOWrite(char *pszFile,WORD hBits);
  161.  
  162. /* Select.C */
  163. extern  VOID PASCAL StartSelection(HWND hWnd,struct tagPOINT ptCurrent,struct tagRECT FAR *lpSelectRect,int idTool);
  164. extern  VOID PASCAL UpdateSelection(HWND hWnd,struct tagPOINT ptCurrent,struct tagRECT FAR *lpSelectRect,int idTool);
  165. extern  VOID PASCAL EndSelection(struct tagPOINT ptCurrent,LPRECT lpSelectRect);
  166. extern  VOID PASCAL ClearSelection(HWND hWnd,struct tagRECT FAR *lpSelectRect,int idTool);
  167. extern  VOID PASCAL SortRect(struct tagRECT FAR *lpRect);
  168.  
  169. /* Toolbox.C */
  170. extern  BOOL PASCAL ToolboxInit(HWND hWnd);
  171. extern  LONG PASCAL FAR ToolBoxWndProc(HWND hWnd,WORD message,WORD wParam,long lParam);
  172. extern  VOID PASCAL DrawUserButton(HWND hWnd,WORD hDC,LPRECT lpRect,int idCtrl,WORD iState,WORD hData,WORD wStyle,int bCurrent);
  173.  
  174.